/**
 * Copyright (c) 时间, Tal.Ben 袁东昊 (ydonghao2@gmail.com).
 *
 * 版权
 */
package com.talben.soudian.fragment.viewpagerfragment;

import android.os.Bundle;
import android.view.View;

import com.talben.soudian.R;
import com.talben.soudian.adapter.ViewPageFragmentAdapter;
import com.talben.soudian.base.BaseFragment;
import com.talben.soudian.base.BaseViewPagerFragment;
import com.talben.soudian.fragment.ApkFragment;


/**
 * @Title: ApkViewPagerFragment.java
 * @Package com.talben.soudian.fragment.viewpagerfragment
 * @Description: apk列表
 * @author Tal.Ben
 * @date 2015年6月14日 下午4:38:46
 * @version v1.0
 */
public class ApkViewPagerFragment extends BaseViewPagerFragment{
	
	
	
	private static int mPosition;

	public static ApkViewPagerFragment newInstance(int position) {
		mPosition = position;
		return new ApkViewPagerFragment();
	}
	
	@Override
	protected void onSetupTabAdapter(ViewPageFragmentAdapter adapter) {
		String[] title = getResources().getStringArray(
				R.array.apk_viewpage_arrays);
		Bundle bundle = new Bundle();
		bundle.putInt(ApkFragment.BUNDLE_APK_TYPE, mPosition);
		adapter.addTab(title[0], "software_catalog",
				ApkFragment.class, bundle);
	}

	@Override
	public void onClick(View v) {

	}

	@Override
	public void initView(View view) {

	}

	@Override
	public void initData() {

	}

	@Override
	public boolean onBackPressed() {
		BaseFragment fragment = (BaseFragment) mTabsAdapter.getItem(mViewPager
				.getCurrentItem());
		if (fragment instanceof ApkFragment) {
			return fragment.onBackPressed();
		}
		return super.onBackPressed();
	}

}

